<template>
  <div class="header">
    <div class="header-wrapper">
      <div class="header-left">
        <ul class="header-li-style">
          <li>
            <a href="">广东</a>
          </li>
          <li>
            <a href="">test23456</a>
          </li>
        </ul>
      </div>
      <div class="header-right">
        <ul class="header-li-style">
          <li>
            <a href="">我的订单</a>
          </li>
          <li>
            <a href="">我的商城</a>
          </li>
          <li>
            <a href="">网站导航</a>
          </li>
          <li>
            <a href="">商家服务</a>
          </li>
        </ul>
      </div>
    </div>
    <div class="nav-wrapper">
      <div class="nav-logo">
        <img src="@/assets/images/logo.png" alt="logo" />
      </div>
      <div class="nav-search">
        <div class="nav-search-container">
          <div class="nav-search-item-search">
            <div class="search-button">
              <input
                class="search-input"
                id="search"
                placeholder=""
                type="text"
                value=""
              />
              <button class="search-bar-btn" type="button">搜 索</button>
            </div>
            <!--            <div class="nav-search-item-hot">-->
            <!--              <ul>-->
            <!--                <li>出口转内销</li>-->
            <!--                <li>端午粽子1元购</li>-->
            <!--                <li>爆款低至85折</li>-->
            <!--                <li>苹果益企焕新季</li>-->
            <!--                <li>企业超市真便宜</li>-->
            <!--                <li>企业团购</li>-->
            <!--              </ul>-->
            <!--            </div>-->
          </div>
          <div class="nav-search-item-car">
            <button class="search-car-btn" type="button">
              <i>
                <i-ep-shopping-cart-full />
              </i>
              我的购物车
            </button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts"></script>

<style scoped lang="scss">
.header {
  background-color: #e3e4e5;

  .header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 74.375rem;
    height: 1.875rem;
    margin: auto;
    font-size: 0.75rem;
    color: #999;

    .header-li-style {
      display: flex;
      list-style: none;
      padding: 0;
    }

    .header-li-style li {
      position: relative;
      margin: 0 0.85rem;
    }

    .header-li-style li:not(:last-child)::after {
      content: '';
      position: absolute;
      right: -0.85rem; /* 调整边框位置(与margin-right一致) */
      top: 30%; /* 控制边框的起始位置 */
      bottom: 30%; /* 控制边框的结束位置 */
      width: 0.0625rem; /* 边框宽度 */
      background: #ccc; /* 边框颜色 */
    }
  }

  .nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 74.375rem;
    width: 100%;
    height: 5rem;
    padding: 0 1rem;
    margin: auto;
    font-size: 0.85rem;
    color: #999;

    .nav-logo {
      //flex: 1;
      flex-shrink: 0;
      align-items: center;

      img {
        width: 11.125rem;
        height: auto;
        max-height: 100%;
      }
    }

    .nav-search {
      flex: 1;
      min-width: 0;
      padding: 0 1rem;

      .nav-search-container {
        display: flex;
        align-items: center;

        .nav-search-item-search {
          max-width: 48rem;
          width: 100%;
          height: 2.5rem;
          border-radius: 0.5rem;
          border: 0.125rem solid #e1251b;

          .search-button {
            position: relative;

            .search-input {
              max-width: 40.9rem;
              width: calc(100% - 6.875rem);
              height: 2.25rem;
              padding: 0 0.75rem;
              border-bottom-left-radius: 0.5rem;
              border-top-left-radius: 0.5rem;
            }

            .search-bar-btn {
              position: absolute;
              right: 0;
              top: 0;
              width: 6.875rem;
              height: 2.3rem;
              background-color: #e1251b;
              border: none;
              font-size: 1rem;
              color: #fff;
              border-top-right-radius: 0.3rem;
              border-bottom-right-radius: 0.3rem;
            }
          }

          .nav-search-item-hot {
            & > ul {
              display: flex;
              height: 1.25rem;
              line-height: 1.25rem;

              & > li:not(:first-child) {
                margin-left: 0.75rem;
              }
            }
          }
        }

        .nav-search-item-car {
          margin-left: 0.75rem;
          margin-right: 0.77rem;

          .search-car-btn {
            width: 10rem;
            height: 2.75rem;
            border: 0.0625rem solid #ccc;
            border-radius: 0.5rem;
            font-size: 1rem;
            font-weight: bold;
            background-color: #fff;
            color: rgba(0, 0, 0, 0.85);
            cursor: pointer;

            & > i {
              margin-right: 0.5rem;
            }

            &:hover {
              color: red;
            }
          }
        }
      }
    }
  }
}

@media (max-width: 1190px) {
  .menu-item-tool {
    display: none;
  }
}

@media (max-width: 992px) {
  .nav-logo {
    display: none;
  }
}

@media (max-width: 425px) {
  .nav-logo {
    display: none;
  }

  .nav-search-item-car {
    display: none;
  }

  .nav-search {
    padding: 0 !important;
  }

  .header-left {
    display: none;
  }
}
</style>
